<?php
$query = "select * from tbl_whis_carriers";
$result = mysql_query($query);
?>
<script type="text/javascript" >
function opendialog(obj,type)
{
	openalertdialog(obj,type);
}
function openalertdialog(id,type)
{
	jQuery("#dialog").dialog("destroy");
	jQuery("#dialog").dialog({
	resizable: false,
	height:148,
	modal: true,
	buttons: {
		'Delete': function() {
			jQuery.post("/aec1/pages/update_cprofile.php",{name:type,id:id},function(data){
			jQuery('#whis_del'+id).hide(function(){
				jQuery('#whis_del'+id).remove();
			});
			$( "#dialog:ui-dialog" ).dialog( "destroy" );
			$( "#dialog-message" ).dialog({
			modal: true,
			buttons: {
				Ok: function() {
					$(this).dialog( "close" );
				}
			}
			});
			});
				
		jQuery(this).dialog('close');
		},
		Cancel: function() {
		jQuery(this).dialog('close');
		}
			}
		});
}

</script>
<!-- ui-dialog -->
<div id="dialog-message" title="Success Delete" style="display:none;">
	<p>
		<span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
		Selected record has been deleted successfully.
	</p>
	
</div>

<div id="dialog" title="Dialog Title" style="display:none">
	<p>Are you sure, you want to delete the selected item?</p>
</div>

<fieldset>
<h3><strong>List of WholeSale Carriers</strong></h3>
<a href='index.php?page=wholesale-carriers'>Add New</a>
<table cellspacing='2' cellpadding='5' style="font-size:1.1em;color:#222222;font-family:Verdana,Arial,sans-serif;">
	<tr style="background-color:#0673C5;color:#FFFFFF;">
		<th>CIC</th>
		<th>Name</th>
		<th>Actions</th>
	</tr>
	<? while($whis = mysql_fetch_array($result)){?>
	<tr id="whis_del<?=$whis['id'];?>" style="background-color:#E6E9F2;">
		<td><? echo $whis['whls_carriers_id']?></td>
		<td><? echo $whis['whls_carriers_name']?></td>
		<td>
		<a href="index.php?page=wholesale-carriers&Id=<?=$whis['id'];?>" title="Edit"><div class="ui-icon ui-icon-pencil" style="float:left;"></div></a>
		<a href="javascript:void(0)" onclick="opendialog(<?=$whis['id'];?>,'wholeSale')" class="ui-corner-all" title="Delete"><span class="ui-icon ui-icon-trash"></span></a>
		</td>
	</tr>
	<?}?>
</table>
</fieldset>